package com.zk.zhikaoyun.common.exception;

import com.zk.zhikaoyun.common.enums.ApiErrorEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 作者：不是凡凡，是鹿晗
 * 时间：2022/11/19 12:37
 * 描述：遇事不决，及时摆烂
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ServiceException extends RuntimeException{

    private Integer code;

    private String msg;

    public ServiceException(ApiErrorEnum errorEnum) {

        this.code = errorEnum.getCode();
        this.msg = errorEnum.getMsg();
    }
}
